package ctrl

import (
	"gitee.com/cloudapex/ulern/htp"
	"gitee.com/cloudapex/ulern/rpc"
)

func init() {

	// rpc client
	rpc.InstCli("MC_C1_RpcCli", func() *rpc.ConfClient {
		return &rpc.ConfClient{
			Servers: []rpc.ServerHost{{"demo", true, "127.0.0.1:12000"}},
			Opts: rpc.ClientOpts{
				Cred:  rpc.OptCred{Enable: false},
				Keep:  rpc.OptKeep{Enable: true},
				Balan: "round_robin",
				Retry: rpc.OptRetry{Enable: true},
				Stats: true,
			},
		}
	})

	// http server
	htp.Install("MC_S1_Server", func() *htp.Config {
		return &htp.Config{
			RunMode:    "debug",
			ListenAddr: ":11000",
		}
	})
}
